//
//  BKRefreshGifHeader.m
//  JiFengDaRen
//
//  Created by SH_iOS on 2017/8/8.
//  Copyright © 2017年 SH_iOS. All rights reserved.
//

#import "BKRefreshGifHeader.h"

@implementation BKRefreshGifHeader



+ (instancetype)bkHeaderWithRefreshingBlock:(MJRefreshComponentRefreshingBlock)refreshingBlock
{
    BKRefreshGifHeader *header = [BKRefreshGifHeader headerWithRefreshingBlock:refreshingBlock];
    header.lastUpdatedTimeLabel.hidden = YES; // 隐藏时间
    header.stateLabel.hidden = YES; // 隐藏状态
    
//    UIImageView *topView = [[UIImageView alloc]init];
//    topView.image = [UIImage imageNamed:@"sm_navigationbar"];
//    [header addSubview:topView];
//    [topView mas_makeConstraints:^(MASConstraintMaker *make) {
//        make.left.equalTo(header.mas_left);
//        make.bottom.equalTo(header.mas_top).offset(54);
//        make.height.mas_equalTo(__I6Height(1000));
//        make.width.mas_equalTo(KScreenWidth);
//        
//    }];
    
    
    return header;
}


#pragma mark - 重写方法
#pragma mark 基本设置
- (void)prepare
{
    [super prepare];
    
    
    // 设置即将刷新状态的动画图片（一松开就会刷新的状态）
    NSMutableArray *refreshingImages = [NSMutableArray array];
    for (NSUInteger i = 1; i<=24; i++) {
        UIImage *image = [UIImage imageNamed:[NSString stringWithFormat:@"shrefresh%zd_03", i]];
        [refreshingImages addObject:image];
    }
    [self setImages:refreshingImages forState:MJRefreshStatePulling];
    
    // 设置正在刷新状态的动画图片
    [self setImages:refreshingImages forState:MJRefreshStateRefreshing];
}

@end
